<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Promotion/actionGoodsList')}" method="post">
                                    <div class="form-group">
                                        <input type="text" name="keywords" class="form-control" placeholder="搜索">
                                    </div>
                                    <button type="submit" class="btn btn-primary">提交</button>
                                    <div class="form-group pull-right">
                                        <a href="{:U('Promotion/actionGoodsInfo')}" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>添加活动</a>
                                    </div>
                                </form>
                            </div>
                        </nav>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable">
                                    <thead>
                                        <tr role="row">
                                            <th class="sorting text-center" tabindex="0">活动名称</th>
                                            <th class="sorting text-center" tabindex="0">活动类型</th>
                                            <th class="sorting text-center" tabindex="0">适用范围</th>
                                            <th class="sorting text-center" tabindex="0">开始时间</th>
                                            <th class="sorting text-center" tabindex="0">结束时间</th>
                                            <th class="sorting text-center" tabindex="0">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="prom_list" item="vo" key="k">
                                            <tr role="row">
                                                <td>{$vo.name|getSubstr=0,30}</td>
                                                <td>{$parse_type[$vo[type]]}</td>
                                                <td>{$vo.group_name}</td>
                                                <td align="center">{$vo.start_time|date='Y-m-d',###}</td>
                                                <td align="center">{$vo.end_time|date='Y-m-d',###}</td>
                                                <td>
                                                    <a href="javascript:;" data-url="{:U('Promotion/getGoods',array('id'=>$vo['id']))}" data-toggle="tooltip" title="" class="btn btn-info goodsList">查看商品</a>
                                                    <a class="btn btn-primary" href="{:U('Promotion/actionGoodsInfo',array('id'=>$vo['id']))}"><i class="fa fa-pencil"></i></a>
                                                    <a class="btn btn-danger" href="{:U('Promotion/actionGoodsDel',array('id'=>$vo['id']))}" data-url=" " data-id="{$vo.id}"><i class="fa fa-trash-o"></i></a>
                                                </td>
                                            </tr>
                                        </foreach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
$('.goodsList').click(function() {
    var url = $(this).attr('data-url');
    layer.open({
        type: 2,
        title: '活动关联商品列表',
        shadeClose: true,
        shade: 0.5,
        area: ['70%', '72%'],
        content: url,
    });
});
</script>
</body>

</html>
